package dao;

import model.Employer;
import utils.JDBCUtils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class AdmitDao {
    Connection connection;

    {
        try {
            connection = JDBCUtils.getConnection();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
    public boolean login(String username , String password) throws SQLException {
        String sql = " select * from admit where account = ? and password = ?";
        PreparedStatement statement = connection.prepareStatement(sql);
        statement.setString( 1,username);
        statement.setString(2 , password);
        ResultSet set = statement.executeQuery();
        boolean flag = false;
        if (set.next()) {
            flag = true;
        }
        return flag;
    }


}
